package com.bestcem.xm.label.grpc.service.param.label;

import com.bestcem.xm.common.core.constant.RegTypes;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import static com.bestcem.xm.label.constant.Constants.LABEL_VALUE_NAME_MAX_LEN;

/**
 * 标签值更新 参数校验
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/5/21
 */

@Getter
@Setter
@ToString
public class UpdateLabelValueParam {

    /**
     * 标签值id
     */
    @NotBlank(message = "标签值id不能为空")
    @Pattern(regexp = RegTypes.OBJECT_ID, message = "标签值id格式错误")
    private String id;

    /**
     * 标签值条件
     */
    private String condition;

    /**
     * 标签值名称
     */
    @NotBlank(message = "标签值名称不能为空")
    @Size(max = LABEL_VALUE_NAME_MAX_LEN, message = "标签值名称长度不能超过30")
    private String value;

    /**
     * 标签值序号
     */
    @NotNull(message = "标签值序号不能为空")
    private Integer serial;

}
